package com.itheima.admin.controller;

import com.itheima.admin.dto.AdChannelPageRequestDto;
import com.itheima.admin.dto.AdSensitivePageRequestDto;
import com.itheima.admin.pojo.AdSensitive;
import com.itheima.admin.service.AdSensitiveService;
import com.itheima.common.vo.PageResultVo;
import com.itheima.core.controller.AbstractCoreController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version 1.0
 * @description 说明
 * @package com.itheima.admin.controller
 */
@RestController
@RequestMapping("/sensitive")
@Api(tags = "敏感词汇管理")
public class AdSensitiveController extends AbstractCoreController<AdSensitive> {

    private AdSensitiveService adSensitiveService;

    @Autowired
    public AdSensitiveController(AdSensitiveService coreService){
        super(coreService);
        this.adSensitiveService = coreService;
    }

    /**
     * 敏感词分页查询
     * @param dto
     * @return
     */
    @PostMapping("/list")
    @ApiOperation("敏感词分页查询")
    public PageResultVo list(@RequestBody AdSensitivePageRequestDto dto){
        PageResultVo vo = adSensitiveService.findPage(dto);
        return vo;
    }
}
